package jetbrains.buildServer.cuta.logic.operators;


import jetbrains.buildServer.cuta.logic.ColumnDef;
import jetbrains.buildServer.cuta.logic.sheet.Cell;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;



/**
 * Base class for all operators.
 * @author Leonid Bushuev from JetBrains
 */
public abstract class AbstractOperator
{

    /**
     * Called when the config file is readed and parsed.
     *
     * <p>
     * When do you implement this method - please peek all needed
     * info from the given XML element and save it in your own
     * fields but do NOT preserve references to the given XML element
     * because it will prevent XML tree collecting by GC.
     * </p>
     *
     * @param element  XML element related to this operator.
     * @param column   column definition
     * @param extContext
     */
    public abstract void init(Element element, ColumnDef column, ExternalContext extContext);


    public abstract void run(Object object, Cell cell);


    @NotNull
    public abstract String name();

}
